# +----------------------------------------------------------------------
# | Pink [ A modern python web framework ]
# +----------------------------------------------------------------------
# | Copyright (c) 2023 http:#unnnnn.com All rights reserved.
# +----------------------------------------------------------------------
# | Author: chenjianhua <unnnnn@foxmail.com>
# +----------------------------------------------------------------------

from ..exceptions import ModelNotFoundException


class ModelNotFoundHandler:
    def __init__(self, application):
        self.application = application

    def handle(self, exception):
        _exception = ModelNotFoundException(
            "No record found with the given primary key"
        )
        self.application.make("exception_handler").handle(_exception)
